<template>
	<view>
		<activity-list v-if="myMovementList.length!=0" @loadMyActivity="loadMyActivity()" :userId="loginUserInfo.id" :needQuitActivity="true" :border="true" :data="myMovementList"></activity-list>
		<view style="margin-top: 20rpx;text-align: center;" v-else>
			---您未参与任何活动---
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations,
		mapActions
	} from 'vuex'
	import activityList from "./activity-list.vue";
	export default {
		computed: mapState(['isLogin', 'loginUserInfo']),
		components: {activityList},
		data() {
			return {
				myMovementList:[]
			}
		},
		onShow(){
			this.loadMyActivity();
		},
		methods: {
			loadMyActivity(){
				uni.request({
					url: this.url.usermovement.getOneUserAllMovement+"/"+this.loginUserInfo.id,
					method: 'GET',
					header: {},
					success: (res) => {
						console.log(res)
						this.myMovementList = res.data.myMovementList
						console.log(this.myMovementList)
					},
					fail: (res) => {
						console.log(res)
					}
				});
			}
		}
	}
</script>

<style>

</style>
